<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<div id="ha">
			
		</div>
		<script type="text/javascript">
			var s = '<a href="xxx">xxxababa</a><br />fjaljoxox<br /><img src="xxxx"/><br />fjaljfoxoxoaa<br /><p>fjxxp</p><b>fjdlfjo</b>'
			s = s.replace(/<\/?(img|a)[^>]*>/gi, '');
			document.getElementById('ha').innerHTML = s;
		</script>
	</body>

</html>